package com.wrupple.muba.widget.client.widgets.table;

import com.google.gwt.user.cellview.client.AbstractPager;
import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.client.ui.SimpleLayoutPanel;
import com.wrupple.muba.common.client.DelegateHasData;
import com.wrupple.muba.widget.client.widgets.panels.InfiniteScrollPager;

public class TableWithPager<T> extends DelegateHasData<T> {

	

	CellTable<T> table;

	InfiniteScrollPager pager;

	public TableWithPager(){
		this(new CellTable<T>());
	}

	public TableWithPager(CellTable<T> tab) {
		table = tab;
		table.setWidth("100%");
		pager = new InfiniteScrollPager();
		pager.setDisplay(table);
		setDelegate(table);
		SimpleLayoutPanel p = new SimpleLayoutPanel();
		p.setWidget(pager);
		initWidget(p);
	}
	

	public CellTable<T> getTable() {
		return table;
	}

	public AbstractPager getPager() {
		return pager;
	}


}
